package cn.wgx.commons.util;

import javax.servlet.http.HttpServletRequest;


/**
 * 单次请求缓存
 */
public class HttpServletRequestUtil {


    public static void setAttribute(String key, Object o){
        HttpServletRequest request = Servlets.getRequest();
        if(request != null)
        request.setAttribute(key, o );
    }

    public static Object getAttribute(String key){
        HttpServletRequest request = Servlets.getRequest();
        if(request != null)
        return request.getAttribute(key);
        return null;
    }

}
